<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>draw</title>
		<script type="text/javascript" src="../load_lufylegend.js"></script>
	</head>
	<body>
		<div id="legend"></div>
		<script>
			LInit(50, "legend", 800, 480, main);
			function main() {
				var loader = new LLoader();
				loader.addEventListener(LEvent.COMPLETE, loadBitmapdata);
				loader.load("face.jpg", "bitmapData");
			}
			function loadBitmapdata(event) {
				var bitmapData, bitmapDataBase, matrix;
				bitmapDataBase = new LBitmapData(event.target, 0, 0, 240, 240, LBitmapData.DATA_CANVAS);

				bitmapData = new LBitmapData(event.target);

				matrix = new LMatrix();
				matrix.translate(120, 50);
				matrix.scale(0.5, 0.8);
				matrix.rotate(30);
				bitmapDataBase.draw(bitmapData, matrix, null, null, new LRectangle(50, 50, 100, 100));

				matrix = new LMatrix();
				matrix.translate(130, 100);
				var color = new LColorTransform(0.2, 0.4, 0.4, 1, 0, 0, 0, 0);
				bitmapDataBase.draw(bitmapData, matrix, color, null, new LRectangle(80, 50, 100, 100));

				matrix = new LMatrix();
				matrix.translate(50, 20);
				bitmapDataBase.draw(bitmapData, matrix, null, LBlendMode.LIGHTER, new LRectangle(120, 120, 90, 90));

				var bitmapBase = new LBitmap(bitmapDataBase);
				addChild(bitmapBase);
			}
		</script>
	</body>
</html>